package company.dj_F;

import java.util.Arrays;
import java.util.Scanner;

public class DaJ1 {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        // bug数
        int n = sc.nextInt();
        // 提升效率
        int a = sc.nextInt();
        // 可以喝几杯咖啡
        int x = sc.nextInt();
        int[] cost = new int[n];
        for (int i = 0; i < n; i++) {
            cost[i] = sc.nextInt();
        }
        Arrays.sort(cost);
        int result = 0;
        x = Math.min(x, 8);
        int lastMin = x * 60;
        for (int i = n - 1; i >= 0; i--) {
            if (lastMin == 0)
                result += cost[i];
            else {
                int num = cost[i] / a;
                boolean last = cost[i] % a == 0;
                if (num <= lastMin) {
                    lastMin = lastMin - num - (last ? 1 : 0);
//                    lastMin -= num ;
                    result = result + num + (last ? 1 : 0);
//                    result += num;
                } else {
                    result = result + lastMin + (cost[i] - lastMin * a);
                    lastMin = 0;
                }
            }
        }
        //
        //int result = sum - x * (60 - 60 / a);
        result = result > 480 ? 0 : result;
        System.out.println(result);
    }
}
